package com.mantru.iotpot.Util;

import android.content.Context;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;

import android.widget.TextView;
import android.widget.Toast;

import com.mantru.iotpot.R;

public class ToastUtils {

    public static void show(Context context, String msg){
        Toast toast = new Toast(context);
        View view = LayoutInflater.from(context).inflate(R.layout.layout_toast, null);
        TextView textView = view.findViewById(R.id.tv_toast_message);
        textView.setText(msg);
        toast.setView(view);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.setDuration(Toast.LENGTH_SHORT);
        toast.show();
    }
}
